package com.rc.evcharger.service.order;

import com.rc.evcharger.common.base.BaseService;
import com.rc.evcharger.mapper.order.OrderInfoMapper;
import com.rc.evcharger.model.member.MemberInfo;
import com.rc.evcharger.model.order.OrderInfo;
import com.rc.evcharger.model.order.OrderInfoExample;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * Created by sven on 2019/09/23.
 */
public interface OrderInfoService extends BaseService<Long, OrderInfo, OrderInfoExample, OrderInfoMapper> {
    /**
     * 添加订单
     */
    OrderInfo addOrder(String rtua, String gun, String orderNum);

    void updateStatusByOrderInfo(Long orderId);

    /**
     * 正常结算+出现在断网超时时后台进行结算订单
     *
     * @param orderNum
     */
    //void updateOrder(String orderNum, Integer stopReason);

    //void updateOrder(String rtua, String gunNum);

    void updateOrderBySocOrVin(Long orderId, BigDecimal soc, String vin);

    /**
     * 获取会员最后订单
     *
     * @param cardNo 卡号
     * @return 最后订单
     */
//    Order getLastByMember(String cardNo);

    /**
     * 根据订单ID查询订单
     *
     * @param orderId
     * @return
     */
//    Order getByOrderId(Long orderId);

    /**
     * 根据订单号获取对应订单
     */
    //OrderInfo getByOrderNum(String orderNum);

    /**
     * 查询多充会员中正在充电的订单数（5小时内）
     *
     * @param memberInfo
     * @return
     */
    Integer countElecOrder(MemberInfo memberInfo);

    /**
     * 根据订单号获取对应订单
     *
     * @param orderNum
     * @return
     */
    OrderInfo selectByOrderNum(String orderNum);

    OrderInfo selectNewOrderByMemberIdAndGunId(Long memberId, Long gunId);

    OrderInfo selectNewOrderByMemberId(Long memberId);

    /**
     * 查询充电中订单
     **/
    OrderInfo selectByPileIdAndGunId(Long elecPileId, Long elecGunId);

    List<OrderInfo> listDdByDateAndMemberId(@Param("date") String date, @Param("memberId") Long memberId);

    List<OrderInfo> listExceptionOrderInfoKy();

    void updateBeginSocByOrderId(Long orderId, BigDecimal beginSoc);

    List<OrderInfo> listNotFinishedOrder(Date startTime, Date endTime);

    int updateStatusByHlhtOrderInfo(Long orderId);


    OrderInfo selectLikeOrderNum(String orderNum);

    List<OrderInfo> queryExcetptionOrderInfo();

    int insertSelectiveBackOrderId(OrderInfo orderInfo);
}
